<?php
/**
 * @page ad_module Ad Module
 * 
 * This module can be used to show the randomized ads across the website. Before using this module
 * one should go through @ref managing_ads
 * 
 * @image html ads_module.jpg
 * 
 */
class SliderModule extends GigaModule
{
	var $name = 'Sliders Module';
	var $configuration = null;
	function __construct()
	{
		$this->configuration = array(
		'zone' => array('type' => 'select', 'label' => 'Select a zone','empty'=>__('-Select-'),
					'validate' => VALID_NOT_EMPTY)
	);
		$optionList = array();
		$zoneConfig = cr('Zone.zone');
		if($zoneConfig)
		{
			$optionList = unserialize($zoneConfig);	
			$optionList = array_map('trim',$optionList);
			$optionList = array_combine($optionList,$optionList);
		}
		$this->configuration['zone']['options'] = $optionList;
	}
	
	function render($params)
	{
		$slidersData = false;
		if(!empty($params['zone']))
		{
			App::import('Helper','Sliders.Sliders');
			$slidersHelper = new SlidersHelper;
			$slidersData = $slidersHelper->show($params['zone']);
		}
		return $slidersData;
	}
}
?>